package com.whlilong.jxc.dialog;

import java.util.ArrayList;
import java.util.List;

import org.eclipse.nebula.widgets.datechooser.DateChooserCombo;
import org.eclipse.swt.SWT;
import org.eclipse.swt.layout.FormAttachment;
import org.eclipse.swt.layout.FormData;
import org.eclipse.swt.layout.FormLayout;
import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.layout.GridLayout;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Control;
import org.eclipse.swt.widgets.Group;
import org.eclipse.swt.widgets.Label;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.swt.widgets.Text;

import com.whlilong.jxc.model.Purcharsbook;

public class PurchasBookSearchByConditon extends AbstractDialog {
	private List<Purcharsbook> list = new ArrayList<Purcharsbook>();
	private Text text;
	private Text text_1;
	private Text text_2;
	private Text text_6;
	private Text text_7;
	private Text text_8;

	public PurchasBookSearchByConditon(Shell parentShell) {
		super(parentShell);
	}

	public Control createGroupText(Composite parent) {
		
		Group group = new Group(parent, SWT.NONE);
		group.setText("条件查询");
		group.setLayout(new FormLayout());
		FormData fd_group = new FormData();
		fd_group.bottom = new FormAttachment(80, 10);
		fd_group.top = new FormAttachment(0, 10);
		fd_group.right = new FormAttachment(100, -10);
		fd_group.left = new FormAttachment(0, 10);
		group.setLayoutData(fd_group);
		
		Composite composite = new Composite(group, SWT.NONE);
		FormData fd_composite = new FormData();
		fd_composite.bottom = new FormAttachment(90);
		fd_composite.left = new FormAttachment(0);
		composite.setLayoutData(fd_composite);
		GridLayout gl_composite = new GridLayout(6, false);
		gl_composite.verticalSpacing = 10;
		composite.setLayout(gl_composite);
		
		Label label = new Label(composite, SWT.NONE);
		label.setLayoutData(new GridData(SWT.RIGHT, SWT.CENTER, false, false, 1, 1));
		label.setText("商品编号：");
		
		text = new Text(composite, SWT.BORDER);
		GridData gd_text = new GridData(SWT.FILL, SWT.CENTER, true, false, 1, 1);
		gd_text.widthHint = 80;
		text.setLayoutData(gd_text);
		
		Label label_1 = new Label(composite, SWT.NONE);
		label_1.setLayoutData(new GridData(SWT.RIGHT, SWT.CENTER, false, false, 1, 1));
		label_1.setText("订单号：");
		
		text_1 = new Text(composite, SWT.BORDER);
		GridData gd_text_1 = new GridData(SWT.FILL, SWT.CENTER, true, false, 1, 1);
		gd_text_1.widthHint = 80;
		text_1.setLayoutData(gd_text_1);
		
		Label label_2 = new Label(composite, SWT.NONE);
		label_2.setLayoutData(new GridData(SWT.RIGHT, SWT.CENTER, false, false, 1, 1));
		label_2.setText("商品条码：");
		
		text_2 = new Text(composite, SWT.BORDER);
		GridData gd_text_2 = new GridData(SWT.FILL, SWT.CENTER, true, false, 1, 1);
		gd_text_2.widthHint = 80;
		text_2.setLayoutData(gd_text_2);
		
		Label label_7 = new Label(composite, SWT.NONE);
		label_7.setLayoutData(new GridData(SWT.RIGHT, SWT.CENTER, false, false, 1, 1));
		label_7.setText("商品名称：");
		
		text_6 = new Text(composite, SWT.BORDER);
		text_6.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 1, 1));
		
		Label label_8 = new Label(composite, SWT.NONE);
		label_8.setLayoutData(new GridData(SWT.RIGHT, SWT.CENTER, false, false, 1, 1));
		label_8.setText("供应商：");
		
		text_7 = new Text(composite, SWT.BORDER);
		text_7.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 1, 1));
		Label label_6 = new Label(composite, SWT.NONE);
		label_6.setLayoutData(new GridData(SWT.RIGHT, SWT.CENTER, false, false, 1, 1));
		label_6.setText("仓库：");
		
		text_8 = new Text(composite, SWT.BORDER);
		text_8.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 1, 1));
		
		Label label_3 = new Label(composite, SWT.NONE);
		label_3.setLayoutData(new GridData(SWT.RIGHT, SWT.CENTER, false, false, 1, 1));
		label_3.setText("查询时间：");
		
		Label label_4 = new Label(composite, SWT.NONE);
		label_4.setLayoutData(new GridData(SWT.RIGHT, SWT.CENTER, false, false, 1, 1));
		label_4.setText("从");
		
		DateChooserCombo dateChooserCombo = new DateChooserCombo(composite, SWT.NONE);
		
		Label label_5 = new Label(composite, SWT.NONE);
		label_5.setLayoutData(new GridData(SWT.RIGHT, SWT.CENTER, false, false, 1, 1));
		label_5.setText("到");
		
		DateChooserCombo dateChooserCombo_1 = new DateChooserCombo(composite, SWT.NONE);
		
		
		return parent;
		
	}
	public List<Purcharsbook> getList() {
		// TODO Auto-generated method stub
		return list;
	}

	public void setList(List<Purcharsbook> list) {
		this.list = list;
	}
}
